function myAjax(method, url, meg, callback) {
    //创建ajax对象
    var xmlHttp = new XMLHttpRequest();
    //初始化ajax
    xmlHttp.open(method, url);
    //设置HTTP的conten-type
    xmlHttp.setRequestHeader("content-type", "application/x-www-form-urlencoded");
    //发送请求
    xmlHttp.send(meg);
    //监听状态码的改变，获取并处理数据
    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState === 4 && xmlHttp.status === 200) {
            var data = xmlHttp.responseText;
            var jdata = JSON.parse(data);
            callback(jdata);
        }
    }
}